package models

import (
	"gorm.io/gorm"
	"zk507/common/inits"
)

type User struct {
	gorm.Model
	Mobile string `gorm:"type:char(11);comment:'手机号'"`
}

func (*User) TableName() string {
	return "user"
}

func (u *User) GetUserMobileInfo(mobile string) error {
	if err := inits.DB.Debug().Where("mobile=?", mobile).Limit(1).Find(&u).Error; err != nil {
		return err
	}
	return nil
}
